#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "dialog.h"
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::on_pushButton_clicked()
{
    dialog* dl = new dialog(this);
    dl->resize(400, 400);
    dl->setWindowTitle("这是一个子窗口");
    dl->show();
    dl->setAttribute(Qt::WA_DeleteOnClose);
}
